<?php
include("db_connect.php");
$onoff=true;
$sql = "select * from tbl_banner_img ORDER BY time DESC limit 9"; 
$result = mysql_query($sql);
while($rows = mysql_fetch_array($result) ){

echo	'<li>';
echo		'<a href="images/'.$rows["imgName"].'" title="'.$rows["title"].'"><img src="images/thumbs/"/></a> ' ;               
echo			'<a href="#" target="_blank"></a>';

	if($onoff){
		$onoff = false;
		echo	'<div style="left:5px; top:240px; width:300px; height:0; color:#f71313; background-color:#bfafaf"> ';
	}
	
	else{
		$onoff= true;
		echo	'<div style="left:650px; top:10px; width:300px; height:0;  color:red; background-color:#FFF"> ';
	}
	

echo					'<h1 style="color:#000000;">'.$rows["title"].'</h1>';
	$content = substr($rows['content'],0,100);
echo					'<p align="justify">'.$content.'</p>';
echo				'</div> ';                             	                           
echo	'</li>';


}







?>